﻿Imports drawing.CommonInterfaces.UI.interfaces


Public Class Ellipse
    Implements IShape
    Implements IViewable


    Dim _x, _y, _width, _height As Integer
    Dim _pen As Pen
    Sub New()
        _y = 0
        _x = 0
        _width = 0
        _height = 0
        _pen = New Pen(Color.Azure)
    End Sub

    Sub New(ByVal rect As Rectangle)
        _y = rect.Y
        _x = rect.X
        _width = rect.Width
        _height = rect.Height
        _pen = New Pen(Color.Azure)
    End Sub

    Sub New(ByVal pen As Pen, ByVal rect As Rectangle)
        _y = rect.Y
        _x = rect.X
        _width = rect.Width
        _height = rect.Height
        _pen = pen
    End Sub

    Public Function getClippingRectangle() As System.Drawing.Rectangle Implements IShape.getClippingRcangle
        Return New Rectangle(X, Y, width, height)
    End Function

    Public Sub draw(ByRef graph As System.Drawing.BufferedGraphics) Implements IViewable.draw
        graph.Graphics.DrawEllipse(Me.pen, Me.getClippingRectangle)

    End Sub

    Public Sub resetSize(ByVal size As System.Drawing.Rectangle) Implements IViewable.resetSize

    End Sub

    Public Property height() As Integer Implements IShape.height
        Get
            Return Me._height
        End Get
        Set(ByVal value As Integer)
            Me._height = value
        End Set
    End Property

    Public Property width() As Integer Implements IShape.width
        Get
            Return Me._width
        End Get
        Set(ByVal value As Integer)
            Me._width = value
        End Set
    End Property

    Public Property X() As Integer Implements IShape.X
        Get
            Return Me._x
        End Get
        Set(ByVal value As Integer)
            Me._x = value
        End Set
    End Property

    Public Property Y() As Integer Implements IShape.Y
        Get
            Return Me._y
        End Get
        Set(ByVal value As Integer)
            Me._y = value
        End Set
    End Property

    Public Property pen() As System.Drawing.Pen Implements IShape.pen
        Get
            Return Me._pen

        End Get
        Set(ByVal value As System.Drawing.Pen)

        End Set
    End Property
End Class
